// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/deliverorder/api/WoDeliverApi'

import AddClass from '@api/deliverorder/model/InsertWoDeliverReq'
import BaseClass from '@api/deliverorder/model/WoDeliverDto'

const CLIENT = CORE.grpcCLIENT(Client)

const BASE = [BaseClass, 'woDeliverDto']

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 增 —————————————————————————————— //

  async add(one, TIP = '工单新增') {
    const DTO = CORE.grpcDTO(AddClass, one, BASE)
    const resp = await CORE.grpc(TIP, CLIENT, 'insertWoDeliver', DTO)
    return [CORE.grpcOK(TIP), resp.woDeliverDto || {}]
  },
}
